%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/v4/connections-order-computed-column"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: Access[9], Access[10], Object[11]<br />2: PgSelect[8], PgSelect[15]<br />3: Connection[12], Connection[17]<br />4: 19, 22"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 12, 19<br /><br />ROOT Connectionᐸ8ᐳ[12]"):::bucket
    Bucket2("Bucket 2 (nullableBoundary)<br />Deps: 17, 22<br /><br />ROOT Connectionᐸ15ᐳ[17]"):::bucket
    Bucket5("Bucket 5 (listItem)<br /><br />ROOT __Item{5}ᐸ19ᐳ[25]"):::bucket
    Bucket6("Bucket 6 (listItem)<br /><br />ROOT __Item{6}ᐸ22ᐳ[27]"):::bucket
    Bucket7("Bucket 7 (nullableBoundary)<br />Deps: 26<br /><br />ROOT PgSelectSingle{5}ᐸpersonᐳ[26]"):::bucket
    Bucket8("Bucket 8 (nullableBoundary)<br />Deps: 28<br /><br />ROOT PgSelectSingle{6}ᐸpersonᐳ[28]"):::bucket
    end
    Bucket0 --> Bucket1 & Bucket2
    Bucket1 --> Bucket5
    Bucket2 --> Bucket6
    Bucket5 --> Bucket7
    Bucket6 --> Bucket8

    %% plan dependencies
    Object11{{"Object[11∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access10{{"Access[10∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access9 & Access10 --> Object11
    PgSelect8[["PgSelect[8∈0] ➊<br />ᐸpersonᐳ"]]:::plan
    Object11 --> PgSelect8
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access9
    __Value2 --> Access10
    Connection12[["Connection[12∈0] ➊<br />ᐸ8ᐳ"]]:::plan
    PgSelect8 --> Connection12
    PgSelect15[["PgSelect[15∈0] ➊<br />ᐸpersonᐳ"]]:::plan
    Object11 --> PgSelect15
    Connection17[["Connection[17∈0] ➊<br />ᐸ15ᐳ"]]:::plan
    PgSelect15 --> Connection17
    ConnectionItems19[["ConnectionItems[19∈0] ➊"]]:::plan
    Connection12 --> ConnectionItems19
    ConnectionItems22[["ConnectionItems[22∈0] ➊"]]:::plan
    Connection17 --> ConnectionItems22
    __Item25[/"__Item[25∈5]<br />ᐸ19ᐳ"\]:::itemplan
    ConnectionItems19 ==> __Item25
    PgSelectSingle26{{"PgSelectSingle[26∈5]<br />ᐸpersonᐳ"}}:::plan
    __Item25 --> PgSelectSingle26
    __Item27[/"__Item[27∈6]<br />ᐸ22ᐳ"\]:::itemplan
    ConnectionItems22 ==> __Item27
    PgSelectSingle28{{"PgSelectSingle[28∈6]<br />ᐸpersonᐳ"}}:::plan
    __Item27 --> PgSelectSingle28
    PgClassExpression29{{"PgClassExpression[29∈7]<br />ᐸ__person__.”id”ᐳ"}}:::plan
    PgSelectSingle26 --> PgClassExpression29
    PgClassExpression31{{"PgClassExpression[31∈7]<br />ᐸ__person__...full_name”ᐳ"}}:::plan
    PgClassExpression29 o--o PgClassExpression31
    PgClassExpression30{{"PgClassExpression[30∈8]<br />ᐸ__person__.”id”ᐳ"}}:::plan
    PgSelectSingle28 --> PgClassExpression30
    PgClassExpression32{{"PgClassExpression[32∈8]<br />ᐸ__person__...full_name”ᐳ"}}:::plan
    PgClassExpression30 o--o PgClassExpression32

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect8,Access9,Access10,Object11,Connection12,PgSelect15,Connection17,ConnectionItems19,ConnectionItems22 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2 bucket2
    classDef bucket5 stroke:#7fff00
    class Bucket5,__Item25,PgSelectSingle26 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,__Item27,PgSelectSingle28 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,PgClassExpression29,PgClassExpression31 bucket7
    classDef bucket8 stroke:#dda0dd
    class Bucket8,PgClassExpression30,PgClassExpression32 bucket8

